<include file="Public/head" />
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/css/cashier.css" />
</head>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar" menu="cwgl.fkd"/>
    <div class="mianR">
        <table class="receivables-cont">
            <tbody>
            <tr>
                <td>付款单号</td>
                <td>{$info.payment_no}</td>
                <td>付款类型</td>
                <td><?php echo $type_list[$info['pay_type']];?></td>
                <td>付款金额</td>
                <td>{$info.amount} 元</td>

            </tr>
            <tr>
                <td>车辆编号</td>
                <td>{$info.car_source_nu}</td>
                <td>付款单创建时间</td>
                <td>{$info.create_time}</td>
                <td>付款方式</td>
                <td><?php echo $ways[$info['pay_way']];?></td>
                <!--<td>付款单状态</td>-->
                <!--<td>{$info.status_cn}</td>-->
            </tr>
            <tr>
                <td>拍单号</td>
                <td>{$info.order_no}</td>
                <td>付款完成时间</td>
                <td>{$info.update_time}</td>
                <td>付款人</td>
                <td>{$info.emp_name}</td>
            </tr>
            <tr>
                <td>变更单号</td>
                <td>{$info.modify_no}</td>
            </tr>
            <tr>
                <td>采购单号</td>
                <td>{$info.purchase_order_nu}</td>
            </tr>
            </tbody>
        </table>
        <h3 class="yonghu">付款明细</h3>
        <table class="receivables-cont" style="width:400px;margin-top:0;">
            <tbody>
            <?php if($info['pay_type']==4 ):?>
                <tr>
                    <td></td>
                    <td>车款应收</td>
                    <td>{$fee.final_price} 元</td>
                </tr>
                <!--<tr>-->
                    <!--<td>抽奖立减</td>-->
                    <!--<td>+ {$fee.lottery} 元</td>-->
                <!--</tr>-->
                <!--<tr>-->
                    <!--<td>线下活动减免</td>-->
                    <!--<td>+ {$fee.activity_reduction} 元</td>-->
                <!--</tr>-->
                <!--<tr>-->
                    <!--<td>代金券</td>-->
                    <!--<td>+ {$fee.coupon} 元</td>-->
                <!--</tr>-->
                <!--<tr>-->
                    <!--<td>交易服务费</td>-->
                    <!--<td>- {$fee.commision}</td>-->
                <!--</tr>-->
                <!--<tr>-->
                    <!--<td>交付服务费</td>-->
                    <!--<td>- {$fee.transfer_fee}</td>-->
                <!--</tr>-->
                <tr>
                    <td>-</td>
                    <td>违约金</td>
                    <td>{$changeInfo.dealer_deduction} 元</td>
                </tr>
                <tr>
                    <td>+</td>
                    <td>赔付</td>
                    <td> {$changeInfo.dealer_compensate} 元</td>
                </tr>
                <tr>
                    <td>=</td>
                    <td>财务退款</td>
                    <td>{$info.amount} 元</td>
                </tr>
            <?php elseif($info['pay_type']==7):?>
                
            <?php else:?>
            <tr>
                <td><?php echo $type_list[$info['pay_type']];?></td>
                <td>{$info.amount} 元</td>
            </tr>
            <?php endif;?>
            </tbody>
        </table>
        <table class="receivables-cont">
            <thead>
                <tr>
                    <th>账号ID</th>
                    <th>收款账号</th>
                    <th>收款人</th>
                    <th>收款银行</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>{$info.account_id}</td>
                    <td>{$info.card_no}</td>
                    <td>{$info.account_name}</td>
                    <td>{$info.bank_name}</td>
                </tr>
            </tbody>
        </table>
        <div class="yongBtn">
            <?php if($info['status']==0):?>
            <input type="button" class="quxiao" id="confirmCollect" value="确认付款">
              <?php if($lockAuth===true):?>
                <input type="button" class="quxiao" onclick="lock()" value="锁定">
              <?php endif;?>
            <?php elseif($info['status']==2):?>
              <?php if($lockAuth===true):?>
                <input type="button" class="quxiao" onclick="unlock()" value="解锁">
              <?php endif;?>
            <?php endif;?>
            <input type="button" class="quxiao" onclick="window.close()" value="关闭">
        </div>
        <div class="clear"></div>
    </div>
</div>
</body>
<script type="text/javascript">

    $("#confirmCollect").click(function () {
        $(".yunBei").css("display",'block');
        $.post("/Payment/confirm",{'id':"<?php echo $info['id'];?>"},function (data) {
            if(data.code!=200){
                shibai_alert(data.msg,1000,function () {
                    $(".yunBei").css("display",'none');
                    return false
                })
            }else {
                btn_alert("确认成功",1000,function () {
                    window.opener.location.reload()
                    window.close()
                })
            }
        },'json');
    });

    function lock() {
        var url = "/Payment/lock";
        _myPost(url)
    }
    function unlock() {
        var url = "/Payment/unlock"
        _myPost(url)
    }
    function _myPost(url) {
        $.post(url,{'id':"<?php echo $info['id'];?>"},function (data) {
            if(data.code!=200){
                shibai_alert(data.msg,1000,function () {
                    $(".yunBei").css("display",'none');
                    return false
                })
            }else {
                btn_alert(data.msg,1000,function () {
                    window.location.reload()
                })
            }
        },'json');
    }
</script>
<include file="Public/foot" />